/**
 *
 */
package org.jprobe.codegen;

import java.lang.reflect.Method;
import java.util.Set;

import org.jprobe.JProbeException;


/**
 * specifications of bean inspector,
 * the role of this object is to access a given
 * class, initialize it, and then run each getter
 * method and record its value and the return type,
 * if the return type is an object, then get all of its
 * getters, until we reach a point where a method returns
 * a primitive value
 *
 * @author Hussain Al-Mutawa
 * @version 2.0
 * @since 1.0
 */
public interface BeanInspectorInterface {
	/**
	 * inspects the current bean and records the results
	 * @throws JProbeException if the bean can not be initialized
	 **/
	void inspect() throws Exception;
	/**
	 * resets the results buffer
	 **/
	void reset();
	/**
	 * gets the class which is to be inspected
	 * @return class type of the bean
	 */
	Class<?>getBean();
	/**
	 * sets the bean to be inspected.
	 * this method calls <code>reset()</code>
	 * automatically
	 * @param bean the bean to be inspected
	 */
	void setBean(Class<?>bean);
	/**
	 * gets list of accessible public getters
	 * @return array of methods
	 */
	Method[] getPublicMethods();
	/**
	 * gets list of non-accessible methods
	 * @return array of non public methods
	 */
	Method[] getPrivateMethods();
	/**
	 * gets list of all methods
	 * @return array of public/non-public methods declared by the bean
	 */
	Method[] getGettersMethods();
	/**
	 * gets a value returned by a method of a given method is a key
	 * @param method the method for which getting the return value
	 * @return the value returned by the getter
	 */
	BeanGetterValueInterface get(Method method);
	/**
	 * gets the bean instance
	 * @return bean instance
	 */
	Object getBeanInstance();
	/**
	 * gets a value returned by a method of <code>java.lang.reflect.Method.toString()</code> method
	 * @param methodToString the method for which getting the return value
	 * @return the value returned by the getter
	 */
	BeanGetterValueInterface get(String methodToString);
	/**
	 * gets set of setters
	 * @return set of methods which returns nothing
	 */
	Set<Method> getVoidMethods();
}
